@extends('admin.layouts.wap')
@section('title', '小程序列表')

@section('content')
<script type="text/javascript" src="/assets/admin/js/dev/miniapp.setting.875451.js?v={{ time() }}"></script>
<div class="miniapp-list-top">
    <div class="miniapp-list-cotainer">
        <a href="/admin/miniapps/miniapp_register">注册新小程序</a>
        <a href="javascript:;" onclick="miniappBindLink();">绑定已有小程序</a>
    </div>
</div>
<div class="mview-card-content" style="margin-top:60px;">
    @forelse($minilists as $minilist)
    @if(empty($minilist->appid))
    <a class="mview-image-card-item" href="/admin/miniapps/miniapp_error/{{ $minilist->id }}">
    @else
    <a class="mview-image-card-item" href="/admin/miniapps/miniapp_detial/{{ $minilist->appid }}">
    @endif
        <div class="mview-header">
            <img src="{{ empty($minilist->head_img) ? 'https://img.moreqifu.com/uploads/20231128/202311281151253583.png' : $minilist->head_img }}">
            <div class="left">
                <h3>{{ $minilist->name }}</h3>
                <h5>APPID: {{ $minilist->appid }}</h5>
            </div>
            @if($minilist->beian == 1)
            <div class="right">
                <p><i class="iconfont icon-dian"></i>待备案</p>
                <p>未提交备案</p>
            </div>
            @elseif($minilist->beian == 2)
            <div class="right">
                <p class="m-text-warning"><i class="iconfont icon-dian"></i>待备案</p>
                <p>待补充资料</p>
            </div>
            @elseif($minilist->beian == 3)
            <div class="right">
                <p class="m-text-warning"><i class="iconfont icon-dian"></i>备案中</p>
                <p>请等待审核</p>
            </div>
            @elseif($minilist->beian == 4)
            <div class="right">
                <p class="m-text-danger"><i class="iconfont icon-shibai"></i>未通过</p>
                <p>修改后重备案</p>
            </div>
            @else
            <div class="right">
                <p class="m-text-success"><i class="iconfont icon-chenggong"></i>已备案</p>
                <p></p>
            </div>
            @endif
        </div>
        <ul>
            <li>
                <p>小程序类型</p>
                @if($minilist->principal_type == 0)
                <span>个人小程序</span>
                @elseif($minilist->principal_type == 1)
                <span>企业小程序</span>
                @elseif($minilist->principal_type == 2)
                <span>媒体小程序</span>
                @elseif($minilist->principal_type == 3)
                <span>政府小程序</span>
                @else
                <span>其他小程序</span>
                @endif
            </li>
            <li>
                <p>授权方式</p>
                @if($minilist->bind_type == 1)
                <span>自有绑定</span>
                @elseif($minilist->bind_type == 2)
                <span>执照注册</span>
                @else
                <span>公众号注册</span>
                @endif
            </li>
            <li>
                <p>上架状态</p>
                @if($minilist->status == 1)
                <span class="m-text-success">已上架</span>
                @elseif($minilist->status == 2 || $minilist->status == 3)
                <span>试用预授权</span>
                @elseif($minilist->status == 4)
                <span>等待认证</span>
                @elseif($minilist->status == 5)
                <span>未提交审核</span>
                @elseif($minilist->status == 6)
                <span class="m-text-warning">审核中</span>
                @elseif($minilist->status == 7)
                <span class="m-text-danger">审核未通过</span>
                @else
                <span class="m-text-primary">待发布</span>
                @endif
            </li>
        </ul>
        <div class="mview-footer">
            <p>授权时间: {{ $minilist->created_at }}</p>
            <p class="m-text-primary">查看详情<i class="iconfont icon-toRight-fill"></i></p>
        </div>
    </a>
    @empty
    <div class="mview-image-card-item">
        <div class="mview-header">
            <div class="left">
                <h3>当前暂无小程序</h3>
                <h5>您可以选择添加小程序或者注册微信小程序！</h5>
            </div>
        </div>
    </div>
    @endforelse
</div>
@endsection
